package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.domain.KingAllocateDetailEntity;
import com.ly.heart.mapper.KingAllocateDetailMapper;
import com.ly.heart.service.IKingAllocateDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 调拨单明细Service业务层处理
 * 
 * @author wutao
 * @date 2024-08-07
 */
@Service
public class KingAllocateDetailServiceImpl extends ServiceImpl<KingAllocateDetailMapper, KingAllocateDetailEntity> implements IKingAllocateDetailService
{
    @Autowired
    private KingAllocateDetailMapper erpKingAllocateDetailMapper;

    /**
     * 查询调拨单明细
     * 
     * @param id 调拨单明细ID
     * @return 调拨单明细
     */
    @Override
    public KingAllocateDetailEntity selectErpKingAllocateDetailById(String id)
    {
        return erpKingAllocateDetailMapper.selectErpKingAllocateDetailById(id);
    }

    /**
     * 查询调拨单明细列表
     * 
     * @param erpKingAllocateDetail 调拨单明细
     * @return 调拨单明细
     */
    @Override
    public List<KingAllocateDetailEntity> selectErpKingAllocateDetailList(KingAllocateDetailEntity erpKingAllocateDetail)
    {
        return erpKingAllocateDetailMapper.selectErpKingAllocateDetailList(erpKingAllocateDetail);
    }

    /**
     * 新增调拨单明细
     * 
     * @param erpKingAllocateDetail 调拨单明细
     * @return 结果
     */
    @Override
    public int insertErpKingAllocateDetail(KingAllocateDetailEntity erpKingAllocateDetail)
    {
        erpKingAllocateDetail.setCreateTime(DateUtils.getNowDate());
        return erpKingAllocateDetailMapper.insertErpKingAllocateDetail(erpKingAllocateDetail);
    }

    /**
     * 修改调拨单明细
     * 
     * @param erpKingAllocateDetail 调拨单明细
     * @return 结果
     */
    @Override
    public int updateErpKingAllocateDetail(KingAllocateDetailEntity erpKingAllocateDetail)
    {
        erpKingAllocateDetail.setUpdateTime(DateUtils.getNowDate());
        return erpKingAllocateDetailMapper.updateErpKingAllocateDetail(erpKingAllocateDetail);
    }

    /**
     * 批量删除调拨单明细
     * 
     * @param ids 需要删除的调拨单明细ID
     * @return 结果
     */
    @Override
    public int deleteErpKingAllocateDetailByIds(String[] ids)
    {
        return erpKingAllocateDetailMapper.deleteErpKingAllocateDetailByIds(ids);
    }

    /**
     * 删除调拨单明细信息
     * 
     * @param id 调拨单明细ID
     * @return 结果
     */
    @Override
    public int deleteErpKingAllocateDetailById(String id)
    {
        return erpKingAllocateDetailMapper.deleteErpKingAllocateDetailById(id);
    }
}
